<script setup>
import {ref} from "vue";
let emit = defineEmits(['say-hello'])

let msg = ref('hello')


// 通过事件将数据传递出去
function buttonClick(){
  emit('say-hello', msg.value)
}

</script>

<template>
    <button @click="buttonClick">子传父</button>
</template>

<style scoped>

</style>